#include <iostream>
#include <sstream>
#include <cstdlib>
#include "command.h"
#include "pizzType.h"
#include "frontEnd.hh"

FrontEnd::FrontEnd(Manager* m) {
    _m = m;
}

FrontEnd::~FrontEnd() {
}

void FrontEnd::run() {
    std::cout << "Do you want a pizza ? > ";
    struct command c;
    std::string str0;
    std::string str1;
    std::string str2;
    std::cin >> str0 >> str1 >> str2;

    c = transform(str0, str1, str2);
    //std::cout << str1 << std::endl << str2 << std::endl << str3 << std::endl;
    _m->newCommand(c);
}

struct command FrontEnd::transform(const std::string& name, const std::string& size, const std::string& number) {
    struct command c;
    (void)name;
    (void)size;

    c.name = Regina;
    c.size = S;
    c.number = std::atoi(number.c_str());
    return c;
}
